package org.example.thread.threadException;

import lombok.SneakyThrows;

/**
 * @Auther:Liu
 * @Testname:DemoB
 * @Date:2025/8/14 15:04
 */
public class DemoB {

    @SneakyThrows
    public synchronized void a1(){
        String name = Thread.currentThread().getName();
        System.out.println(name + " is running");
      wait();
        System.out.println(name + " is stopped");
    }



    @SneakyThrows
    public synchronized void a3(){
       notifyAll();
    }

    @SneakyThrows
    public synchronized void a2(){
        String name = Thread.currentThread().getName();
        System.out.println(name + " is running");
        wait(4000);
        System.out.println(name + " is stopped");
    }
}
